<?php
namespace Home\Model;
use Think\Model\ViewModel;
class ScheduleViewModel extends ViewModel {
    public $viewFields = array(     
        'schedule'=>array('id','name','time','class_id'),  //查询的主表   
        'gradesclass'=>array('lecture','teacher_id','headmaster_id','time_slot','staff_id','content', '_on'=>'schedule.class_id=gradesclass.id'), //_on多表联查条件    
		'curriculum'=>array('cname','money', '_on'=>'gradesclass.lecture=curriculum.id'),
		'staff'=>array('name'=>'teacher_name', '_on'=>'gradesclass.teacher_id=staff.id'),
		'other'=>array('name'=>'slot_name', '_on'=>'gradesclass.time_slot=other.id'),
		'room'=>array('roomname', '_on'=>'gradesclass.staff_id=room.id')
		//'staff'=>array('name'=>'headmaster_name', '_on'=>'gradesclass.headmaster_id=staff.id')
    );
}